package org.example.designPattern.behavioral.chain;

import java.util.Iterator;
import java.util.List;

public class ZipProcessor extends FileProcessor{
    public ZipProcessor() {
    }

    public ZipProcessor(FileProcessor nextFileProcessor) {
        super(nextFileProcessor);
    }

    @Override
    public void execute(List<String> urls) {
        System.out.println("=======ZipProcessor========");
        Iterator<String> iterator = urls.iterator();
        while (iterator.hasNext()){
            String next = iterator.next();
            if(next.contains(".zip")){
                System.out.println(next + " 是.zip类型，即将进行处理");
                iterator.remove();
            }
        }
    }
}
